package xyz.zhzby.cyzx.oj.messenger;

import io.swagger.annotations.ApiModel;
import lombok.Getter;
import org.springframework.context.ApplicationEvent;

/**
 * @author zby
 * @date 2022/02/05
 */
@Getter
@ApiModel("提交评测记录事件消息")
public class SubmissionEvent extends ApplicationEvent {

    private static final long serialVersionUID = 4808514481370058683L;

    private final int type;

    private final Long submissionId;

    private final Long userId;

    private final Long pageId;

    private final String judgeResult;

    private final String runtimeOutput;

    private final String message;

    private final boolean isCompleted;

    /**
     * @Param [source, submissionId, judgeResult, message, isCompleted]
     * @Param [消息发布源, 提交评测记录的唯一标识符, 当前评测结果, 评测消息, 评测是否完成]
     * @Return []
     * @Author zby
     * @Date 2022/02/05
     * @Description SubmissionEvent的构造函数.
     */
    public SubmissionEvent(Object source, int type, long submissionId, long userId, long pageId, String judgeResult,
                           String runtimeOutput, String message, boolean isCompleted) {
        super(source);
        this.type = type;
        this.submissionId = submissionId;
        this.userId = userId;
        this.pageId = pageId;
        this.judgeResult = judgeResult;
        this.runtimeOutput = runtimeOutput;
        this.message = message;
        this.isCompleted = isCompleted;
    }

}
